import request from '@/utils/request'

// 获取权限列表
export function getPermissionList() {
  return request({
    method: 'GET',
    url: '/sys/permission'
  })
}

// 分配权限
export function assignPermission(data) {
  return request({
    method: 'PUT',
    url: '/sys/role/assignPrem',
    data
  })
}

// 删除权限点
export function delPermissionById(id) {
  return request({
    method: 'DELETE',
    url: `/sys/permission/${id}`
  })
}

// 添加权限点
export function addPermission(data) {
  return request({
    method: 'POST',
    url: '/sys/permission',
    data
  })
}
// 编辑权限点
export function editPermission(id, data) {
  return request({
    method: 'PUT',
    url: '/sys/permission/' + id,
    data
  })
}
